//
//  IMTCarStatistics.m
//  INMOTION
//
//  Created by 方人疋 on 2018/4/3.
//  Copyright © 2018年 Inmotion. All rights reserved.
//

#import "IMTCarStatistics.h"

@implementation IMTCarStatistics

- (void)loadChargingStatistisWithData:(NSData *)data {
    if (data.length >= 8) {
        UInt32 mileage = 0, totalEnergy = 0;
        [data getBytes:&mileage range:NSMakeRange(0, 4)];
        [data getBytes:&totalEnergy range:NSMakeRange(4, 4)];
        self.mileageBeforeCharging = mileage / 100000.0;
        self.totalEnergyBeforeCharging = totalEnergy * 2.7778 / 100;
    }
}

@end
